home *** CD-ROM | disk | FTP | other *** search
- { SPX Library Version 3.0 Copyright 1993 Scott D. Ramsay }
-
- SPX_SFN is the raster font handling unit. It also allows you to
- display your own fonts mono-or multicolor fonts. Has a built in small
- text font. (Font used in GUI- of vspmaker and geomaker.)
-
- You can make your own fonts using the VSP2SFN.EXE utility
- or convert existing fonts to VSP format for editing. (SFN2VSP.EXE)
-
- ───────────────────────────────────────────────────────────────────────────
- type
- psfn_type = ^sfn_type;
- sfn_type = record
- w,h : integer;
- data : pointer;
- end;
-
- sfn_type defines a font type.
-
- w,h define the font's maximum width and height.
- data is the font's actual data
-
- ───────────────────────────────────────────────────────────────────────────
- var
- SFNx : integer; { current X position }
- currentSFN : psfn_type; { pointer to the current font type }
- sfnWidth : array[0..255] of byte; { list of current font widths }
- sfnHeight : array[0..255] of byte; { list of current font heights }
-
- ───────────────────────────────────────────────────────────────────────────
- function stlen(s:string):word;
-
- Returns the width of the string in pixels based on the current font.
-
- S: String to check
-
- ───────────────────────────────────────────────────────────────────────────
- function LoadSfn(fn:string;var font:sfn_type):integer;
-
- Loads a .SFN font file from disk. Returns 0 for no error or
- a SFN error code.
-
- ───────────────────────────────────────────────────────────────────────────
- function LoadSfnLib(lib:pSpxLib;fn:string;var font:sfn_type):integer;
-
- Loads a .SFN font from a SPX archive file. Returns 0 for no error or
- a SFN error code.
-
- ───────────────────────────────────────────────────────────────────────────
- procedure SetSFN(var font:sfn_type);
-
- Sets the current font.
-
- font: must be a valid pre-loaded font.
-
- ───────────────────────────────────────────────────────────────────────────
- procedure SetSFNdefault;
-
- Set the current font to the internal font type
-
- ───────────────────────────────────────────────────────────────────────────
- procedure FreeSfn(var font:sfn_type);
-
- Frees up a loaded font from memory
-
- ───────────────────────────────────────────────────────────────────────────
- procedure printchar(x,y:integer;h:char);
-
- Displays a character using the current font. Uses the font's
- set colors.
-
- ───────────────────────────────────────────────────────────────────────────
- procedure printletter(x,y:integer;s:string);
-
- Displays a string using the current font. Uses the font's
- set colors.
-
- X,Y: Top-left position to place text;
- S: String to display
-
- ───────────────────────────────────────────────────────────────────────────
- procedure putletter(x,y:integer;c:byte;s:string);
-
- Display a string on the active page, using the current font. All non-zero
- color on the font becomes a single color
-
- X,Y: Top-left position to place text;
- C: Color of text;
- S: String to display
-
- NOTE: IF (X) is negative then the text is centered on the screen
-
- ───────────────────────────────────────────────────────────────────────────
- procedure drawletter(x,y:integer;c,c2:byte;s:string);
-
- Drawletter is the same as putletter with the following addition:
-
- putletter(x+1,y+1,c2,s);
- putletter(x,y,c,s);
-
- This allows for shaded text. Set the GUI's vspmaker and geomaker for
- visual examples.
-
- ───────────────────────────────────────────────────────────────────────────
- procedure putchar(x,y:integer;h:char;c:byte);
-
- Display a character on the active page using the current font.
-
- X,Y: Top-left position to place character;
- H: Character to display;
- C: Color of character
-
- ───────────────────────────────────────────────────────────────────────────